package com.sky.task;

import com.sky.websocket.WebSocketServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 任务
 *
 * @author iTaotao
 * @version 1.0
 * @date 2023/08/07 09:15:38
 */
@Component
@Slf4j
public class DemoTask {

    @Autowired
    private WebSocketServer webSocketServer;

    @Scheduled(cron = "0/5 * * * * ?")
    public void testTask() {
        webSocketServer.sendToAllClient("你好");

    }
}
